package com.itheima.jdbctemplate;

import com.itheima.dao.IAccountDao;
import com.itheima.dao.impl.AccountDaoImpl;
import com.itheima.domain.Account;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class JdbcTemplateDemo04 {
    public static void main(String[] args) {

        //获取容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean2.xml");
        //获取对象
        IAccountDao accountDao = ac.getBean("accountDao", AccountDaoImpl.class);
        Account account = accountDao.findAccountById(1);
        System.out.println(account);

        account.setMoney(3000f);
        accountDao.updateAccount(account);

    }

}
